package cn.zkw.service.impl;

import cn.zkw.mapping.IArticleDao;
import cn.zkw.service.ArticleService;
import cn.zkw.vo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    public IArticleDao dao;

    @Override
    public Integer addArticle(Article article) {
        return dao.addArticle(article);
    }

    @Override
    public List<Article> splitArticle(Integer cp) {
        return dao.splitArticle(cp);
    }

    @Override
    public Integer updateArticle(Article article) {
        return dao.updateArticle(article);
    }

    @Override
    public List<Article> splitArticleback(Integer num) {
        return dao.splitArticleback(num);
    }

    @Override
    public Integer getArticleAllNum() {
        return dao.selectArticleAllNum();
    }

    @Override
    public List<Article> preSplitArticle(Integer num) {
        return dao.preSplitArticle(num);
    }

    @Override
    public Article selectArticleById(Integer article_id) {
        return dao.selectArticleById(article_id);
    }

    @Override
    public boolean updateView(Article article) {
        return dao.updateView(article)>=1;
    }

    @Override
    public List<Article> splitArticleBySort(Map<String, Object> map) {
        return dao.splitArticleBySort(map);
    }

    @Override
    public Integer selectArticleAllNum_BySort(Integer sort_id) {
        return dao.selectArticleAllNum_BySort(sort_id);
    }

    @Override
    public List<Article> splitArticleByKeyWord(Map<String, Object> map) {
        return dao.splitArticleByKeyWord(map);
    }

    @Override
    public Integer selectArticleAllNum_ByKeyWord(Map<String, Object> map) {
        return dao.selectArticleAllNum_ByKeyWord(map);
    }

    @Override
    public Integer deleteArticleSet(List<Integer> idList) {
        return dao.deleteArticleSet(idList);
    }

    @Override
    public List<Article> selectArticleByLabelId(Integer label_id) {
        return dao.selectArticleByLabelId(label_id);
    }

    @Override
    public List<Article> selectArticleByView() {
        return dao.selectArticleByView();
    }

}
